UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y5UHb/Nexp6VQtAcpnq1tFiZugN6BGJQkgy6x9J240M='
WHERE
key_id = '87cc5206a21d4c5935728ca7500c1dbafff281650ae8b56da817d3918b288afc'
AND (
token = 'Y5UHb/Nexp6VQtAcpnq1tFiZugN6BGJQkgy6x9J240M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)