UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eP0GXVS7w9ojWdUQ/y1NAM4KBMJzkr41PiRBoJ+dkv8=' 
WHERE 
  key_id = '86ed39a6a63d49d7c7eb047b4e49368d1d145df54a6a38536b766f3fde176a21' 
  AND (
    token = 'eP0GXVS7w9ojWdUQ/y1NAM4KBMJzkr41PiRBoJ+dkv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044