UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O0DQs6VBT6bi4kvO+erS0PhSuoMcLejjSryYHJQHPkg=' 
WHERE 
  key_id = '8359d1c1cb1bc3a0dc044d98c1721862f057a583ca41c219f81592b44f46ddc7' 
  AND (
    token = 'O0DQs6VBT6bi4kvO+erS0PhSuoMcLejjSryYHJQHPkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043