UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RRzrONDvQVb9ZWT+jjOzRMUyPIDpAjb18aPh6q+wu6c='
WHERE
key_id = '1a6b0bc93fdea2bb751b0e6784cc0941309540fb9524c5d02966ac21f7d6ec1c'
AND (
token = 'RRzrONDvQVb9ZWT+jjOzRMUyPIDpAjb18aPh6q+wu6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)