UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CljESzIAJC37h7akdqMyHg1KHDUv0Bg9I5LWvsAcNMA=' 
WHERE 
  key_id = 'e88c08bef5cdcf8ffcb5cbcb391225bf9a7f0403e6184dde1db4a6a567b0950e' 
  AND (
    token = 'CljESzIAJC37h7akdqMyHg1KHDUv0Bg9I5LWvsAcNMA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023