UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b8Boruklfxi5OyyLt+ZNDQvsnp9bZe/r9DijI0bPrd0=' 
WHERE 
  key_id = 'a159125bc4c70a7597fb49b23e00ac3fb820b12fdb7dfff40d56a8dbffa611b7' 
  AND (
    token = 'b8Boruklfxi5OyyLt+ZNDQvsnp9bZe/r9DijI0bPrd0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032