UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wm0KigSC7FsGPzqFBdTBEphUmBPtVcB2xqua3185tFQ='
WHERE
key_id = '03ec27f7ca6f2467b71b20f198972ba606fad9365e780dcdd178fb3c4ae060c7'
AND (
token = 'wm0KigSC7FsGPzqFBdTBEphUmBPtVcB2xqua3185tFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)