UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yzMt5pFsZqLd+MJaVEmRUECXb+4UQy0PRNQWIy+IygA=' 
WHERE 
  key_id = 'e8c28325dbfc62127c7bd36ef57a50d03eea0789ab4de3f7c00679767d4d354b' 
  AND (
    token = 'yzMt5pFsZqLd+MJaVEmRUECXb+4UQy0PRNQWIy+IygA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064