UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wOCLBceksUpjXSmXQw/I3zMcpBLEpZRGPZH3RGrD1k0='
WHERE
key_id = '42ec684d2068b1dd19ac17d1a63c7f875c69fdafa77fd18828843e1b1935a7fa'
AND (
token = 'wOCLBceksUpjXSmXQw/I3zMcpBLEpZRGPZH3RGrD1k0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)