UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L2qqtYXF8rdn8oWZ/jlQ5T2aLB0elHm+bot8fX54WyI=' 
WHERE 
  key_id = 'cd4367fc8e5bfe493c456832ec8a9af38319f2edb511ca82059606cd8108cd6a' 
  AND (
    token = 'L2qqtYXF8rdn8oWZ/jlQ5T2aLB0elHm+bot8fX54WyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030