UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h28SR2yZbgxv9ONtpJk8cFtD5uprgrWr6DCpUK89WlY=' 
WHERE 
  key_id = '73b6c61c504d5480f8007217cadc1894ee33fd364428cdb3d840c41e6b25f2cd' 
  AND (
    token = 'h28SR2yZbgxv9ONtpJk8cFtD5uprgrWr6DCpUK89WlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030