UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TPBvuSMhnXHDc9UixHVgsV+lq0vQ9z6yoFvB2JVla0A=' 
WHERE 
  key_id = '30ab73b9dd5b4347c241f8828496e49014d286e453ec43b70df8f7033edda86f' 
  AND (
    token = 'TPBvuSMhnXHDc9UixHVgsV+lq0vQ9z6yoFvB2JVla0A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031