UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W6eBmsXmjkWRVei7Zr059RGHgyLj9SMnn6ZWHQR5+lU=' 
WHERE 
  key_id = 'ab9acc48962119383c802fba9e5516e9c6e83ffff7d8ce8fa9413dc72d6844a1' 
  AND (
    token = 'W6eBmsXmjkWRVei7Zr059RGHgyLj9SMnn6ZWHQR5+lU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022