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