UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A6lyKsgMzF2eESnsESu78VHObDoFv5VGrOJfC2bVFDI='
WHERE
key_id = 'e85f61daa71bce2b0451d3488202bab3d2999b3ff9812a19de95a5952092291d'
AND (
token = 'A6lyKsgMzF2eESnsESu78VHObDoFv5VGrOJfC2bVFDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)