UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Rxin8SHiK2JovZHWyde3O0Wj6cBoNu5DPcEaTbMuiU=' 
WHERE 
  key_id = '77636ca41e7ff0aee8570c8fc51232d71372959fd10dc6e1650d364996fe82ee' 
  AND (
    token = '4Rxin8SHiK2JovZHWyde3O0Wj6cBoNu5DPcEaTbMuiU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017