UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EPOU//uIkcxQ6MapbxawoBuKjkfcR4JNekaayyclR/w='
WHERE
key_id = 'bc0ff3b12856535cc8948ffd341163c5f2ac1ec3dce1dad4c4b8becdc58b938c'
AND (
token = 'EPOU//uIkcxQ6MapbxawoBuKjkfcR4JNekaayyclR/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)