UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k6kGrqWnTTUnr6ODW77jlpBBCoxNlJmF+BkJcV+akNk=' 
WHERE 
  key_id = '2b29b1c3fa9678a01fb9266981aaf0929b5e148cc78ded4fd2a7beb76e3be879' 
  AND (
    token = 'k6kGrqWnTTUnr6ODW77jlpBBCoxNlJmF+BkJcV+akNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031