UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I31cxO8oyKbXmCpHk9RrSa6men4iHrWwytRwGj1b4DQ='
WHERE
key_id = '5a91785446bc5a0719a802afe5fbc0ec52c2bd9d2204268b4251f5a9a0c55081'
AND (
token = 'I31cxO8oyKbXmCpHk9RrSa6men4iHrWwytRwGj1b4DQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)