UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tef+5NdpVfsMLu78Lq0gW5nPd6c6MvJ2FflSb0MN9iY=' 
WHERE 
  key_id = 'de95d4f6a532a27c4e90fdf545ec3765b5c22c157ee75d8a5d2dc206018bc935' 
  AND (
    token = 'Tef+5NdpVfsMLu78Lq0gW5nPd6c6MvJ2FflSb0MN9iY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039