UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5MLuE+ZHnF/w9VCdBLTRs6y1rUdtf0b4M2Y+K4saclE=' 
WHERE 
  key_id = 'eeeeb8f24c126336be7b78e4f5183117b4d09e4c2af1e5353274423b3e6056cd' 
  AND (
    token = '5MLuE+ZHnF/w9VCdBLTRs6y1rUdtf0b4M2Y+K4saclE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058