UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BAkf6FXGJArbAi+l04R1nIF2KGswm/um1rUDJ+pbDqM='
WHERE
key_id = '026ac6e63597cb936ce5cbd3100eafcc92294cb0c8444542eb8e26fcfe101b66'
AND (
token = 'BAkf6FXGJArbAi+l04R1nIF2KGswm/um1rUDJ+pbDqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)