UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+UZWi2TnPkDkp4XriogtT37opfKvdkjKzm7dogP2l9c=' 
WHERE 
  key_id = '27e825a3dcd261d1ecfdbf20c776636cef558f76dea6d55e6c4d655dbb4a9195' 
  AND (
    token = '+UZWi2TnPkDkp4XriogtT37opfKvdkjKzm7dogP2l9c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038