UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1IKzaUuFJVOpa/6R09rzlDY+IZeOY8YqhhkThCUi28E='
WHERE
key_id = '563d9e08400a4992f2849e3e18a41236568064c3bf6c8ff44e454bebc1c1a513'
AND (
token = '1IKzaUuFJVOpa/6R09rzlDY+IZeOY8YqhhkThCUi28E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)