UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3FBxc8OMKUfVuOAzGbdki4VSrXbPtZFYXqr3DBeGWQQ='
WHERE
key_id = '4088dd5d69054a7816557450b0093d60d8b905aa949c52e11dba103eaaa9857c'
AND (
token = '3FBxc8OMKUfVuOAzGbdki4VSrXbPtZFYXqr3DBeGWQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)