UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jl/W+caaapKzhAcbINiZS8v3KHKEg0VlSFlMs6v0N8c='
WHERE
key_id = 'f66ccf78e0231a41e41471e6288eda910e58d07e40c488601097ca21cb67938a'
AND (
token = 'Jl/W+caaapKzhAcbINiZS8v3KHKEg0VlSFlMs6v0N8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)