UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U/5Jql2r9/mHoH3vZRunqIQ1XEew8tcdA9p6zF00G8o=' 
WHERE 
  key_id = '040052684a2b491ef39e39ad9595cf6eaf2cf0306597b05da2b79677e0839716' 
  AND (
    token = 'U/5Jql2r9/mHoH3vZRunqIQ1XEew8tcdA9p6zF00G8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042