UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aqAvo3DMoG1YILXFnvGhwhKhMUjkHu2T52HnB3u8pao=' 
WHERE 
  key_id = '11d40b9d13b69dcff431e0cda8955da9ae884e3006af9115d0ac0f19b3dd8d1a' 
  AND (
    token = 'aqAvo3DMoG1YILXFnvGhwhKhMUjkHu2T52HnB3u8pao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066