UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HdXoVTSbpBcfcTtttjpzTiBYdbk/MHFvG1KKDnamu50=' 
WHERE 
  key_id = '684a50dc292ec0dabfd5bafd6d7539df6cec2614cea05e0d5f6a296397940c65' 
  AND (
    token = 'HdXoVTSbpBcfcTtttjpzTiBYdbk/MHFvG1KKDnamu50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029