UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k8xUegVQm8vRsBkvL9tPEt/rZMcnhLGd1r8Bb/FRC3s='
WHERE
key_id = 'feff701140412a2d4d49fa751ade386ea38ac4bf6187a170150a66f97c6612fd'
AND (
token = 'k8xUegVQm8vRsBkvL9tPEt/rZMcnhLGd1r8Bb/FRC3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)