UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KcbDadVn/DLydtOKL1rSrXPxxHPOUo8Z8n9o4s7XCSk='
WHERE
key_id = '3f07f002debccc56269c997010b2966eec4af9653183526607d2dfaf882820a4'
AND (
token = 'KcbDadVn/DLydtOKL1rSrXPxxHPOUo8Z8n9o4s7XCSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)