UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GNbS44nostbmlxXcwdeqKlP3va7GnnEaNjj+b7A5hTA=' 
WHERE 
  key_id = '8f02dfda0d74e1c2ef7227ab3034928587083445fdc1dcf1b7b6bac184132ab7' 
  AND (
    token = 'GNbS44nostbmlxXcwdeqKlP3va7GnnEaNjj+b7A5hTA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033