UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eUcRWdJUsAWtIZaN5bvIpXoTtbqV0/XzHgJOBOrO4Bs='
WHERE
key_id = 'c1f89c03a3743de534a1572b3aef35b082dbca2945d5c19a0a02470095d3e75b'
AND (
token = 'eUcRWdJUsAWtIZaN5bvIpXoTtbqV0/XzHgJOBOrO4Bs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)