UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZkmDBmP7DjkrOM+VsQKt1pTVCYlM7AUJk0j0n3Zv8+o=' 
WHERE 
  key_id = 'e6970e73711c527e2ff888c79bd1ae6b82f22039e36d64b60a2d86300f1d8339' 
  AND (
    token = 'ZkmDBmP7DjkrOM+VsQKt1pTVCYlM7AUJk0j0n3Zv8+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021