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