UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X06Bh6r/Sqf0G7R7Tw+wQ2D51WZlEysaJmxiwhSYiSU=' 
WHERE 
  key_id = 'e01a7861977fb4ded0cbe99830e3fdc37fa9baddb50b9988ab7baa9e57e74140' 
  AND (
    token = 'X06Bh6r/Sqf0G7R7Tw+wQ2D51WZlEysaJmxiwhSYiSU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028