UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iBTt3QsrKtoe61D52Na4Pwppj3JoSwrNUVQGSmZnm+o='
WHERE
key_id = '5c43fbadba5e90deb57908e64ed631746160cb9b40c9bc99afffa89077361296'
AND (
token = 'iBTt3QsrKtoe61D52Na4Pwppj3JoSwrNUVQGSmZnm+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)