UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X/Oo+LBZopA8mQg1E6nN51q/l3LSooqJy1/Oa1aIL68=' 
WHERE 
  key_id = '935259853d87bf01c17f7e16ee333df6f06f4194d9e7fc3036455baebf23a5ad' 
  AND (
    token = 'X/Oo+LBZopA8mQg1E6nN51q/l3LSooqJy1/Oa1aIL68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037