UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z83eDJLmNd+1CWveY1YvBtnyYmZ2USqKTf4LnbGaqeg='
WHERE
key_id = '1a963cb2c9583425918f5302bccc54f1d44f1002764cf19596c1a52ec6ff9334'
AND (
token = 'z83eDJLmNd+1CWveY1YvBtnyYmZ2USqKTf4LnbGaqeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)