UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZuiK1ckqFIH++pNkSE81jv81lKL//sEiSFjgPBb6jQU=' 
WHERE 
  key_id = 'f0b094c8c84228a1f24e63796cdaa07967f801a1407bd3913519ce43cb452fd9' 
  AND (
    token = 'ZuiK1ckqFIH++pNkSE81jv81lKL//sEiSFjgPBb6jQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048