UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vd0580slD5iuDeY4QOcQoYJguqQ10RZB9wjpjdexN5A='
WHERE
key_id = '0431e495c160541cced43fbf040f2a8b2ff22d2735f31892fad3610932f29d33'
AND (
token = 'Vd0580slD5iuDeY4QOcQoYJguqQ10RZB9wjpjdexN5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)