UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dwE1BjyuLsoLRViSO6Fcuv3xOO+Vr8dWwG7gvuATBO0='
WHERE
key_id = '38caa9d838c6f0fe83cdd48a7ef8eb2bf543fcb9cfb07f03767c4fdc0537f511'
AND (
token = 'dwE1BjyuLsoLRViSO6Fcuv3xOO+Vr8dWwG7gvuATBO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)