UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DlH4SWoOqzxxGDaJcavqUIHp0qtBRoWX5fIZheK80Vg='
WHERE
key_id = '7ad5b2166f69c2de47e1044c1e7c4eb8a7ad3d8fbb30a0e8fad1357e931b2fea'
AND (
token = 'DlH4SWoOqzxxGDaJcavqUIHp0qtBRoWX5fIZheK80Vg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)